package fhp.hlhj.giantfold.module

import com.lzy.okgo.model.HttpParams
import fhp.hlhj.giantfold.javaBean.FriendsRankBean
import fhp.hlhj.giantfold.network.UrlApis

/**
 * author: FHP
 * data: on 2018\2\3 0003 9:36
 * E-Mail: 103945089@qq.com
 */
class FriendsRankModule {
    interface onLoadRankListener{
        fun showLoading()
        fun onResp(friendsRankBean: FriendsRankBean)
    }

    fun getFriendsRank(params: HttpParams,listener: onLoadRankListener){
        UrlApis.getFriendsRank(params)
                .doOnSubscribe {
                    listener.showLoading()
                }
                .subscribe {
                    data->
                    listener.onResp(data)
                }
    }
}